

import java.awt.BorderLayout;
import java.awt.Checkbox;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.BorderFactory;
import javax.swing.DebugGraphics;
import javax.swing.DefaultComboBoxModel;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;

import javax.swing.JFormattedTextField;

import javax.swing.JLabel;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;

import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JToggleButton;
import javax.swing.JToolBar;

import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;

import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.MaskFormatter;

import org.jdesktop.beansbinding.AutoBinding.UpdateStrategy;
import org.jdesktop.beansbinding.BeanProperty;
import org.jdesktop.beansbinding.Binding;
import org.jdesktop.beansbinding.BindingGroup;
import org.jdesktop.beansbinding.Bindings;
import org.jdesktop.beansbinding.ELProperty;
import org.jdesktop.layout.GroupLayout;
import org.jdesktop.layout.LayoutStyle;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * OBD2nerForm.java
 *
 * Created on Jul 19, 2010, 10:47:18 AM
 */

/**
 *
 * @author adam
 */
public class OBD2nerForm extends java.awt.Frame {

    /** Creates new form OBD2nerForm */
    public OBD2nerForm() {
         initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new BindingGroup();

        jTabbedPane1 = new JTabbedPane();
        jPanel1 = new JPanel();
        jTextField1 = new JTextField();
        jScrollPane1 = new JScrollPane();
        jLabel2 = new JLabel();
        jButton6 = new JButton();
        jPanel2 = new JPanel();
        jButton4 = new JButton();
        jLabel1 = new JLabel();
        jTextField2 = new JTextField();
        jPanel5 = new JPanel();
        jSeparator1 = new JSeparator();
        jFormattedTextField10 = new JFormattedTextField();
        jFormattedTextField8 = new JFormattedTextField();
        jFormattedTextField4 = new JFormattedTextField();
        jFormattedTextField7 = new JFormattedTextField();
        jFormattedTextField9 = new JFormattedTextField();
        jFormattedTextField3 = new JFormattedTextField();
        jFormattedTextField6 = new JFormattedTextField();
        jFormattedTextField5 = new JFormattedTextField();
        jFormattedTextField1 = new JFormattedTextField();
        jFormattedTextField2 = new JFormattedTextField();
        jLabel5 = new JLabel();
        jLabel6 = new JLabel();
        jLabel7 = new JLabel();
        jLabel8 = new JLabel();
        jLabel9 = new JLabel();
        jToggleButton3 = new JToggleButton();
        jCheckBox16 = new JCheckBox();
        jCheckBox11 = new JCheckBox();
        jCheckBox15 = new JCheckBox();
        jCheckBox20 = new JCheckBox();
        jCheckBox8 = new JCheckBox();
        jCheckBox13 = new JCheckBox();
        jCheckBox18 = new JCheckBox();
        jCheckBox3 = new JCheckBox();
        jCheckBox19 = new JCheckBox();
        jCheckBox10 = new JCheckBox();
        jCheckBox14 = new JCheckBox();
        jCheckBox7 = new JCheckBox();
        jCheckBox2 = new JCheckBox();
        jCheckBox1 = new JCheckBox();
        jCheckBox5 = new JCheckBox();
        jCheckBox6 = new JCheckBox();
        jCheckBox17 = new JCheckBox();
        jCheckBox12 = new JCheckBox();
        jCheckBox4 = new JCheckBox();
        jCheckBox9 = new JCheckBox();
        jPanel3 = new JPanel();
        jTextField4 = new JTextField();
        jLabel4 = new JLabel();
        jComboBox1 = new JComboBox();
        jComboBox2 = new JComboBox();
        checkbox1 = new Checkbox();
        jToggleButton2 = new JToggleButton();
        jButton5 = new JButton();
        jTextField3 = new JTextField();
        jTextField5 = new JTextField();
        jTextField6 = new JTextField();
        jButton2 = new JButton();
        jLabel3 = new JLabel();
        jLabel11 = new JLabel();
        jToolBar1 = new JToolBar();
        jToggleButton1 = new JToggleButton();
        jButton1 = new JButton();

        setLocationRelativeTo(null);
        setTitle("OBD2ner");
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent evt) {
                exitForm(evt);
            }
        });

        jTabbedPane1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
        jTabbedPane1.setTabPlacement(JTabbedPane.LEFT);
        jTabbedPane1.setToolTipText("Set options ");
        jTabbedPane1.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        jTabbedPane1.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
        jTabbedPane1.setMinimumSize(new Dimension(498, 200));
        jTabbedPane1.setPreferredSize(new Dimension(498, 200));

        jPanel1.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));

        jTextField1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });

        jTextArea1.setBackground(new Color(15, 38, 21)); // NOI18N
        jTextArea1.setColumns(20);
        jTextArea1.setForeground(new Color(45, 146, 45));
        jTextArea1.setRows(5);
        jTextArea1.setText("Console>");
        jTextArea1.setWrapStyleWord(true);
        jTextArea1.setFocusable(false);
        jScrollPane1.setViewportView(jTextArea1);

        jLabel2.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent evt) {
                SendLabelClicked(evt);
            }
        });

        jButton6.setIcon(new ImageIcon(getClass().getResource("/sendnormal.png"))); // NOI18N
        jButton6.setContentAreaFilled(false);
        jButton6.setRolloverIcon(new ImageIcon(getClass().getResource("/send.png"))); // NOI18N
        jButton6.setSelectedIcon(new ImageIcon(getClass().getResource("/sendClicked.png"))); // NOI18N
        jButton6.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        GroupLayout jPanel1Layout = new GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.LEADING)
            .add(GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
                .add(jPanel1Layout.createParallelGroup(GroupLayout.TRAILING)
                    .add(GroupLayout.LEADING, jPanel1Layout.createSequentialGroup()
                        .add(251, 251, 251)
                        .add(jLabel2, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE))
                    .add(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .add(jTextField1, GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE)
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jButton6, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
                        .add(20, 20, 20)))
                .add(0, 0, 0))
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jScrollPane1, GroupLayout.DEFAULT_SIZE, 392, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.LEADING)
            .add(GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel2)
                .addPreferredGap(LayoutStyle.RELATED)
                .add(jScrollPane1, GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
                .add(9, 9, 9)
                .add(jPanel1Layout.createParallelGroup(GroupLayout.TRAILING)
                    .add(jButton6, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)
                    .add(jTextField1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Console", jPanel1);

        jPanel2.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));

        jButton4.setText("OK");
        jButton4.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jLabel1.setText("Device:");

        jTextField2.setText(Status.UseDevice);
        jTextField2.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jTextField2ActionPerformed(evt);
            }
        });

        GroupLayout jPanel2Layout = new GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel1)
                .addPreferredGap(LayoutStyle.RELATED)
                .add(jTextField2, GroupLayout.PREFERRED_SIZE, 314, GroupLayout.PREFERRED_SIZE)
                .addContainerGap(31, Short.MAX_VALUE))
            .add(GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(293, Short.MAX_VALUE)
                .add(jButton4, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel2Layout.createParallelGroup(GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(jTextField2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.RELATED, 106, Short.MAX_VALUE)
                .add(jButton4)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Options", jPanel2);

        jPanel5.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
        jPanel5.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        jPanel5.setRequestFocusEnabled(false);
        jFormattedTextField10.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        try {
            jFormattedTextField10.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("HH")));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextField10.setText("00");
        jFormattedTextField10.setToolTipText("text");
        jFormattedTextField10.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
        jFormattedTextField10.setEnabled(false);
        jFormattedTextField10.setVerifyInputWhenFocusTarget(false);
        jFormattedTextField10.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jFormattedTextField10ActionPerformed(evt);
            }
        });
        jFormattedTextField8.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        try {
            jFormattedTextField8.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("HH")));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextField8.setText("00");
        jFormattedTextField8.setToolTipText("text");
        jFormattedTextField8.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
        jFormattedTextField8.setEnabled(false);
        jFormattedTextField8.setVerifyInputWhenFocusTarget(false);
        jFormattedTextField8.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jFormattedTextField8ActionPerformed(evt);
            }
        });
        jFormattedTextField4.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        try {
            jFormattedTextField4.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("HH")));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextField4.setText("00");
        jFormattedTextField4.setToolTipText("text");
        jFormattedTextField4.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
        jFormattedTextField4.setEnabled(false);
        jFormattedTextField4.setVerifyInputWhenFocusTarget(false);
        jFormattedTextField4.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jFormattedTextField4ActionPerformed(evt);
            }
        });
        jFormattedTextField7.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        try {
            jFormattedTextField7.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("HH")));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextField7.setText("00");
        jFormattedTextField7.setToolTipText("text");
        jFormattedTextField7.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
        jFormattedTextField7.setEnabled(false);
        jFormattedTextField7.setVerifyInputWhenFocusTarget(false);
        jFormattedTextField7.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jFormattedTextField7ActionPerformed(evt);
            }
        });
        jFormattedTextField9.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        try {
            jFormattedTextField9.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("HH")));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextField9.setText("00");
        jFormattedTextField9.setToolTipText("text");
        jFormattedTextField9.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
        jFormattedTextField9.setEnabled(false);
        jFormattedTextField9.setVerifyInputWhenFocusTarget(false);
        jFormattedTextField9.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jFormattedTextField9ActionPerformed(evt);
            }
        });
        jFormattedTextField3.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        try {
            jFormattedTextField3.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("HH")));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextField3.setText("00");
        jFormattedTextField3.setToolTipText("text");
        jFormattedTextField3.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
        jFormattedTextField3.setEnabled(false);
        jFormattedTextField3.setVerifyInputWhenFocusTarget(false);
        jFormattedTextField3.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jFormattedTextField3ActionPerformed(evt);
            }
        });
        jFormattedTextField6.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        try {
            jFormattedTextField6.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("HH")));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextField6.setText("00");
        jFormattedTextField6.setToolTipText("text");
        jFormattedTextField6.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
        jFormattedTextField6.setEnabled(false);
        jFormattedTextField6.setVerifyInputWhenFocusTarget(false);
        jFormattedTextField6.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jFormattedTextField6ActionPerformed(evt);
            }
        });
        jFormattedTextField5.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        try {
            jFormattedTextField5.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("HH")));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextField5.setText("00");
        jFormattedTextField5.setToolTipText("text");
        jFormattedTextField5.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
        jFormattedTextField5.setEnabled(false);
        jFormattedTextField5.setVerifyInputWhenFocusTarget(false);
        jFormattedTextField5.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jFormattedTextField5ActionPerformed(evt);
            }
        });
        jFormattedTextField1.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        try {
            jFormattedTextField1.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("HH")));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextField1.setText("01");
        jFormattedTextField1.setVerifyInputWhenFocusTarget(false);
        jFormattedTextField1.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jFormattedTextField1ActionPerformed(evt);
            }
        });
        jFormattedTextField2.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        try {
            jFormattedTextField2.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("HH")));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextField2.setText("00");
        jFormattedTextField2.setToolTipText("text");
        jFormattedTextField2.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
        jFormattedTextField2.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jFormattedTextField2ActionPerformed(evt);
            }
        });

        jLabel5.setText("HEX:");

        jLabel6.setText("Enable");

        jLabel7.setText("Cycle");

        jLabel8.setText("Data In Que:");
        jLabel9.setFont(new Font("DejaVu Sans", 0, 14));
        jLabel9.setText("0100");

        jToggleButton3.setText("Scan Mode");
        jToggleButton3.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jToggleButton3ActionPerformed(evt);
            }
        });

        Binding binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField6, ELProperty.create("${enabled}"), jCheckBox16, BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jCheckBox16.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jCheckBox16ActionPerformed(evt);
            }
        });

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField1, ELProperty.create("${enabled}"), jCheckBox11, BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jCheckBox11.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jCheckBox11ActionPerformed(evt);
            }
        });

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField5, ELProperty.create("${enabled}"), jCheckBox15, BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jCheckBox15.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jCheckBox15ActionPerformed(evt);
            }
        });

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField10, ELProperty.create("${enabled}"), jCheckBox20, BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jCheckBox20.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jCheckBox20ActionPerformed(evt);
            }
        });

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField8, ELProperty.create("${enabled}"), jCheckBox8, BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField3, ELProperty.create("${enabled}"), jCheckBox13, BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jCheckBox13.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jCheckBox13ActionPerformed(evt);
            }
        });

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField8, ELProperty.create("${enabled}"), jCheckBox18, BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jCheckBox18.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jCheckBox18ActionPerformed(evt);
            }
        });

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField3, ELProperty.create("${enabled}"), jCheckBox3, BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField9, ELProperty.create("${enabled}"), jCheckBox19, BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jCheckBox19.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jCheckBox19ActionPerformed(evt);
            }
        });

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField10, ELProperty.create("${enabled}"), jCheckBox10, BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField4, ELProperty.create("${enabled}"), jCheckBox14, BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jCheckBox14.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jCheckBox14ActionPerformed(evt);
            }
        });

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField7, ELProperty.create("${enabled}"), jCheckBox7, BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField2, ELProperty.create("${enabled}"), jCheckBox2, BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField1, ELProperty.create("${enabled}"), jCheckBox1, BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField5, ELProperty.create("${enabled}"), jCheckBox5, BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField6, ELProperty.create("${enabled}"), jCheckBox6, BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField7, ELProperty.create("${enabled}"), jCheckBox17, BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jCheckBox17.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jCheckBox17ActionPerformed(evt);
            }
        });
        jCheckBox12.setSelected(true);

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField2, ELProperty.create("${enabled}"), jCheckBox12, BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jCheckBox12.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                jCheckBox12ActionPerformed(evt);
            }
        });

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField4, ELProperty.create("${enabled}"), jCheckBox4, BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, jFormattedTextField9, ELProperty.create("${enabled}"), jCheckBox9, BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        GroupLayout jPanel5Layout = new GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(GroupLayout.LEADING)
            .add(jPanel5Layout.createSequentialGroup()
                .add(jPanel5Layout.createParallelGroup(GroupLayout.LEADING)
                    .add(jPanel5Layout.createSequentialGroup()
                        .add(19, 19, 19)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.TRAILING)
                            .add(jLabel7)
                            .add(jLabel5)
                            .add(jLabel6))
                        .add(18, 18, 18)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.LEADING)
                            .add(GroupLayout.TRAILING, jFormattedTextField1, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                            .add(GroupLayout.TRAILING, jCheckBox1)
                            .add(GroupLayout.TRAILING, jCheckBox11))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.TRAILING)
                            .add(jFormattedTextField2, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                            .add(jCheckBox12)
                            .add(jCheckBox2))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.TRAILING)
                            .add(jFormattedTextField3, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                            .add(jCheckBox13)
                            .add(jCheckBox3))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.TRAILING)
                            .add(jFormattedTextField4, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                            .add(jCheckBox14)
                            .add(jCheckBox4))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.TRAILING)
                            .add(jFormattedTextField5, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                            .add(jCheckBox15)
                            .add(jCheckBox5))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.TRAILING)
                            .add(jFormattedTextField6, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                            .add(jCheckBox16)
                            .add(jCheckBox6))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.TRAILING)
                            .add(jFormattedTextField7, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                            .add(jCheckBox17)
                            .add(jCheckBox7))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.TRAILING)
                            .add(jFormattedTextField8, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                            .add(jCheckBox18)
                            .add(jCheckBox8))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.LEADING)
                            .add(GroupLayout.TRAILING, jFormattedTextField9, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                            .add(GroupLayout.TRAILING, jCheckBox19)
                            .add(GroupLayout.TRAILING, jCheckBox9))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.LEADING)
                            .add(jCheckBox20)
                            .add(jCheckBox10)
                            .add(jFormattedTextField10, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)))
                    .add(jPanel5Layout.createSequentialGroup()
                        .add(4, 4, 4)
                        .add(jSeparator1, GroupLayout.PREFERRED_SIZE, 474, GroupLayout.PREFERRED_SIZE))
                    .add(jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .add(jLabel8)
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jLabel9, GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jToggleButton3, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE)
                        .add(82, 82, 82)))
                .add(0, 0, 0))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(GroupLayout.LEADING)
            .add(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel5Layout.createParallelGroup(GroupLayout.BASELINE)
                    .add(jLabel5)
                    .add(jFormattedTextField1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField8, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField9, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.RELATED)
                .add(jSeparator1, GroupLayout.PREFERRED_SIZE, 0, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.RELATED)
                .add(jPanel5Layout.createParallelGroup(GroupLayout.LEADING)
                    .add(jCheckBox3)
                    .add(jCheckBox1)
                    .add(jCheckBox2)
                    .add(jCheckBox4)
                    .add(jCheckBox5)
                    .add(jCheckBox6)
                    .add(jCheckBox7)
                    .add(jCheckBox8)
                    .add(jCheckBox9)
                    .add(jLabel6)
                    .add(jCheckBox10))
                .addPreferredGap(LayoutStyle.RELATED)
                .add(jPanel5Layout.createParallelGroup(GroupLayout.TRAILING)
                    .add(jPanel5Layout.createParallelGroup(GroupLayout.LEADING)
                        .add(jLabel7)
                        .add(jPanel5Layout.createParallelGroup(GroupLayout.TRAILING)
                            .add(jCheckBox13)
                            .add(jCheckBox12)
                            .add(jCheckBox11)
                            .add(jCheckBox14)
                            .add(jCheckBox15)
                            .add(jCheckBox16)
                            .add(jCheckBox17)
                            .add(jCheckBox18)
                            .add(jCheckBox19)))
                    .add(jCheckBox20))
                .addPreferredGap(LayoutStyle.RELATED, 52, Short.MAX_VALUE)
                .add(jPanel5Layout.createParallelGroup(GroupLayout.BASELINE)
                    .add(jLabel8)
                    .add(jLabel9)
                    .add(jToggleButton3))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Scanner", jPanel5);

        jPanel3.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));

        jTextField4.setText(Status.ReadFile);

        jLabel4.setText("Read from File");

        jComboBox1.setModel(new DefaultComboBoxModel(new String[] { "Log Level 0", "Log Level 1", "Log Level 2", "Log Level 3" }));
        jComboBox1.setSelectedItem(jComboBox1.getItemAt(Status.LogLevel));
        jComboBox1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });

        jComboBox2.setModel(new DefaultComboBoxModel(new String[] { "Console Level 0", "Console Level 1", "Console Level 2", "Console Level 3" }));
        jComboBox2.setSelectedItem(jComboBox1.getItemAt(Status.ConsoleLevel));
        jComboBox2.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jComboBox2ActionPerformed(evt);
            }
        });

        checkbox1.setLabel("Use when offline");
        checkbox1.setState(Status.UseFileWhenOffline);

        jToggleButton2.setText("ATD ATZ LOOP");
        jToggleButton2.setFocusable(false);
        jToggleButton2.setHorizontalTextPosition(SwingConstants.CENTER);
        jToggleButton2.setVerticalTextPosition(SwingConstants.BOTTOM);
        jToggleButton2.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jToggleButton2ActionPerformed(evt);
            }
        });

        jButton5.setText("OK");
        jButton5.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jTextField3.setText("1");
        jTextField3.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jTextField3ActionPerformed(evt);
            }
        });

        jTextField5.setText("12");
        jTextField5.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jTextField5ActionPerformed(evt);
            }
        });

        jTextField6.setText("1");

        jButton2.setText("jButton2");
        jButton2.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel3.setText("jLabel3");

        jLabel11.setText("jLabel11");

        GroupLayout jPanel3Layout = new GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel3Layout.createParallelGroup(GroupLayout.LEADING)
                    .add(jPanel3Layout.createSequentialGroup()
                        .add(jLabel4)
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jTextField4, GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(checkbox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .add(20, 20, 20))
                    .add(GroupLayout.TRAILING, jPanel3Layout.createSequentialGroup()
                        .add(jPanel3Layout.createParallelGroup(GroupLayout.TRAILING, false)
                            .add(GroupLayout.LEADING, jButton5, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(GroupLayout.LEADING, jToggleButton2, GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jPanel3Layout.createParallelGroup(GroupLayout.LEADING)
                            .add(jComboBox2, 0, 227, Short.MAX_VALUE)
                            .add(jComboBox1, 0, 227, Short.MAX_VALUE)))
                    .add(jPanel3Layout.createSequentialGroup()
                        .add(jTextField3, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jTextField5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(LayoutStyle.UNRELATED)
                        .add(jTextField6, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jLabel3, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(jButton2, GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE))
                    .add(jLabel11))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel3Layout.createParallelGroup(GroupLayout.TRAILING)
                    .add(GroupLayout.LEADING, checkbox1, GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE)
                    .add(GroupLayout.LEADING, jLabel4)
                    .add(GroupLayout.LEADING, jTextField4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.RELATED)
                .add(jPanel3Layout.createParallelGroup(GroupLayout.LEADING)
                    .add(jToggleButton2)
                    .add(jComboBox1, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.RELATED)
                .add(jPanel3Layout.createParallelGroup(GroupLayout.LEADING)
                    .add(jComboBox2, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE)
                    .add(jButton5))
                .addPreferredGap(LayoutStyle.RELATED)
                .add(jLabel11)
                .add(11, 11, 11)
                .add(jPanel3Layout.createParallelGroup(GroupLayout.BASELINE)
                    .add(jTextField3, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE)
                    .add(jTextField5, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE)
                    .add(jLabel3)
                    .add(jTextField6, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE)
                    .add(jButton2, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jTabbedPane1.addTab("debug", jPanel3);

        add(jTabbedPane1, BorderLayout.CENTER);

        jToolBar1.setBackground(new Color(18, 41, 252));
        jToolBar1.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jToolBar1.setRollover(true);
        jToolBar1.setOpaque(false);
        jToolBar1.addComponentListener(new ComponentAdapter() {
            public void componentShown(ComponentEvent evt) {
                jToolBar1Changed(evt);
            }
        });
        jToolBar1.addFocusListener(new FocusAdapter() {
            public void focusLost(FocusEvent evt) {
                jToolBar1FocusLost(evt);
            }
        });

        jToggleButton1.setSelected(Status.Online);
        jToggleButton1.setText("   Connect   ");
        jToggleButton1.setFocusable(false);
        jToggleButton1.setHorizontalTextPosition(SwingConstants.CENTER);
        jToggleButton1.setVerticalTextPosition(SwingConstants.BOTTOM);
        jToggleButton1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jToggleButton1ActionPerformed(evt);
            }
        });
        jToolBar1.add(jToggleButton1);

        jButton1.setText("Master List");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(SwingConstants.CENTER);
        jButton1.setVerticalTextPosition(SwingConstants.BOTTOM);
        jButton1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton1);

        add(jToolBar1, BorderLayout.NORTH);

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /** Exit the Application */
    private void exitForm(WindowEvent evt) {//GEN-FIRST:event_exitForm
        System.exit(0);
    }//GEN-LAST:event_exitForm

    private void jCheckBox12ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jCheckBox12ActionPerformed
        if (jCheckBox12.isSelected()){
            //FormattedTextFieldColor;
            jFormattedTextField2.setForeground(Color.BLUE);
        }else {
            jFormattedTextField2.setBackground(Color.WHITE);
            jFormattedTextField2.setForeground(Color.BLACK);
        }
}//GEN-LAST:event_jCheckBox12ActionPerformed

    private void jCheckBox17ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jCheckBox17ActionPerformed
        if (jCheckBox17.isSelected()){
            //FormattedTextFieldColor;
            jFormattedTextField7.setBackground(Color.BLUE);
            jFormattedTextField7.setForeground(Color.WHITE);
        }else {
            jFormattedTextField7.setBackground(Color.WHITE);
            jFormattedTextField7.setForeground(Color.BLACK);
        }
}//GEN-LAST:event_jCheckBox17ActionPerformed

        private void jCheckBox14ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jCheckBox14ActionPerformed
            if (jCheckBox14.isSelected()){
                //FormattedTextFieldColor;

                jFormattedTextField4.setForeground(Color.BLUE);
            }else {
                jFormattedTextField4.setBackground(Color.WHITE);
                jFormattedTextField4.setForeground(Color.BLACK);
            }
}//GEN-LAST:event_jCheckBox14ActionPerformed

            private void jCheckBox19ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jCheckBox19ActionPerformed
                if (jCheckBox19.isSelected()){
                    //FormattedTextFieldColor;
                    jFormattedTextField9.setForeground(Color.BLUE);
                }else {
                    jFormattedTextField9.setBackground(Color.WHITE);
                    jFormattedTextField9.setForeground(Color.BLACK);
                }
}//GEN-LAST:event_jCheckBox19ActionPerformed

                private void jCheckBox18ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jCheckBox18ActionPerformed
                    if (jCheckBox18.isSelected()){
                        //FormattedTextFieldColor;
                        jFormattedTextField8.setForeground(Color.BLUE);
                    }else {
                        jFormattedTextField8.setBackground(Color.WHITE);
                        jFormattedTextField8.setForeground(Color.BLACK);
                    }
}//GEN-LAST:event_jCheckBox18ActionPerformed

                    private void jCheckBox13ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jCheckBox13ActionPerformed
                        if (jCheckBox13.isSelected()){
                            //FormattedTextFieldColor;
                            jFormattedTextField3.setForeground(Color.BLUE);
                        }else {
                            jFormattedTextField3.setBackground(Color.WHITE);
                            jFormattedTextField3.setForeground(Color.BLACK);
                        }
}//GEN-LAST:event_jCheckBox13ActionPerformed

                        private void jCheckBox20ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jCheckBox20ActionPerformed
                            if (jCheckBox20.isSelected()){
                                //FormattedTextFieldColor;
                                jFormattedTextField10.setForeground(Color.BLUE);
                            }else {
                                jFormattedTextField10.setBackground(Color.WHITE);
                                jFormattedTextField10.setForeground(Color.BLACK);
                            }
}//GEN-LAST:event_jCheckBox20ActionPerformed

                            private void jCheckBox15ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jCheckBox15ActionPerformed
                                if (jCheckBox15.isSelected()){
                                    //FormattedTextFieldColor;
                                    jFormattedTextField5.setForeground(Color.BLUE);
                                }else {
                                    jFormattedTextField5.setBackground(Color.WHITE);
                                    jFormattedTextField5.setForeground(Color.BLACK);
                                }
}//GEN-LAST:event_jCheckBox15ActionPerformed

                                private void jCheckBox11ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jCheckBox11ActionPerformed
                                    if (jCheckBox11.isSelected()){
                                        //FormattedTextFieldColor;
                                        jFormattedTextField1.setForeground(Color.BLUE);
                                    }else {
                                        jFormattedTextField1.setBackground(Color.WHITE);
                                        jFormattedTextField1.setForeground(Color.BLACK);
                                    }
}//GEN-LAST:event_jCheckBox11ActionPerformed

                                private void jCheckBox16ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jCheckBox16ActionPerformed
                                    if (jCheckBox16.isSelected()){
                                        //FormattedTextFieldColor;
                                        jFormattedTextField6.setForeground(Color.BLUE);
                                    }else {
                                        jFormattedTextField6.setBackground(Color.WHITE);
                                        jFormattedTextField6.setForeground(Color.BLACK);
                                    }
}//GEN-LAST:event_jCheckBox16ActionPerformed

                                    private void jToggleButton3ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jToggleButton3ActionPerformed

                                        if (jToggleButton3.isSelected()){
                                            Status.WriteMode="ScanMode";
                                            try {
                                                WriteOut.write("");
                                            } catch (IOException ex) {
                                                Logger.getLogger(OBD2nerForm.class.getName()).log(Level.SEVERE, null, ex);
                                            }

                                        } else {
                                            Status.WriteMode="RandomAccess";
                                        }





}//GEN-LAST:event_jToggleButton3ActionPerformed

                                    private void jFormattedTextField1ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField1ActionPerformed
}//GEN-LAST:event_jFormattedTextField1ActionPerformed

                                    private void jTextField2ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed
}//GEN-LAST:event_jTextField2ActionPerformed

                                    private void jButton4ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
}//GEN-LAST:event_jButton4ActionPerformed

                                    private void jButton2ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
                                        System.out.println(jTextField3.getText()+ " "+ jTextField5.getText()+ " " + jTextField6.getText());

                                        String y = Database.getDataValue( jTextField3.getText(),jTextField5.getText() , jTextField6.getText());
                                        jLabel3.setText(y);
}//GEN-LAST:event_jButton2ActionPerformed

                                    private void jTextField5ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jTextField5ActionPerformed
}//GEN-LAST:event_jTextField5ActionPerformed

                                    private void jTextField3ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed
}//GEN-LAST:event_jTextField3ActionPerformed

                                    private void jButton5ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed

                                        //updates preferences on page
                                        Status.ReadFile = jTextField4.getText();
}//GEN-LAST:event_jButton5ActionPerformed

                                    private void jToggleButton2ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jToggleButton2ActionPerformed
                                        if (jToggleButton2.isSelected()){
                                            Status.WriteMode="WriteList";
                                            Status.WriteList.add("atd");
                                            Status.WriteList.add("atz");
                                            Status.WriteList.add("atd");
                                            try {
                                                WriteOut.write("");
                                            } catch (IOException ex) {
                                                Logger.getLogger(OBD2nerForm.class.getName()).log(Level.SEVERE, null, ex);
                                            }
                                        } else {
                                            Status.WriteMode = "RandomAccess";
                                        }
}//GEN-LAST:event_jToggleButton2ActionPerformed

                                    private void jComboBox2ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jComboBox2ActionPerformed
                                        //This combo box controls console output level
                                        Status.ConsoleLevel=jComboBox2.getSelectedIndex();
                                    }//GEN-LAST:event_jComboBox2ActionPerformed

                                    private void jComboBox1ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed

                                        //This combo box controls Log Level
                                        Status.LogLevel=jComboBox1.getSelectedIndex();
                                    }//GEN-LAST:event_jComboBox1ActionPerformed

                                    private void jButton1ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
                                        Status.MasterList.invokeNewMasterList();
}//GEN-LAST:event_jButton1ActionPerformed

                                    private void jToggleButton1ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
                                        Status.resetAllReaders();
                                        Status.Online = jToggleButton1.isSelected();

                                        if (Status.Online){
                                            SerialInterface.StartStop("start");
                                            jToggleButton1.setText("Disconnect");

                                        } else {

                                            ReadInterpreter.main();
                                            jToggleButton1.setText("  Connect   ");

                                            Synchronizer.main();

                                        }


                                        try {
                                            //TODO get confirmation on online status
                                            WriteOut.write("atz");
                                        } catch (IOException ex) {
                                            Logger.getLogger(OBD2nerForm.class.getName()).log(Level.SEVERE, null, ex);
                                        }

                                    }//GEN-LAST:event_jToggleButton1ActionPerformed

                                    private void SendLabelClicked(MouseEvent evt) {//GEN-FIRST:event_SendLabelClicked
                                        try {
                                            WriteOut.write(jTextField1.getText());
                                        } catch (IOException ex) {
                                            Logger.getLogger(OBD2nerForm.class.getName()).log(Level.SEVERE, null, ex);
                                        }
                                        jTextField1.setText("");
                                        jTextArea1.setText("");
}//GEN-LAST:event_SendLabelClicked

                                    private void jTextField1ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
                                        try {
                                            WriteOut.write(jTextField1.getText());
                                        } catch (IOException ex) {
                                            Logger.getLogger(OBD2nerForm.class.getName()).log(Level.SEVERE, null, ex);
                                        }
                                        jTextField1.setText("");
                                        jTextArea1.setText("");
}//GEN-LAST:event_jTextField1ActionPerformed

                                    private void jToolBar1FocusLost(FocusEvent evt) {//GEN-FIRST:event_jToolBar1FocusLost
                                        repaint();
                                    }//GEN-LAST:event_jToolBar1FocusLost

                                    private void jToolBar1Changed(ComponentEvent evt) {//GEN-FIRST:event_jToolBar1Changed
                                       repaint();
                                    }//GEN-LAST:event_jToolBar1Changed

                                    private void jFormattedTextField10ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField10ActionPerformed
}//GEN-LAST:event_jFormattedTextField10ActionPerformed

                                    private void jFormattedTextField9ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField9ActionPerformed
}//GEN-LAST:event_jFormattedTextField9ActionPerformed

                                    private void jFormattedTextField8ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField8ActionPerformed
}//GEN-LAST:event_jFormattedTextField8ActionPerformed

                                    private void jFormattedTextField7ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField7ActionPerformed
}//GEN-LAST:event_jFormattedTextField7ActionPerformed

                                    private void jFormattedTextField6ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField6ActionPerformed
}//GEN-LAST:event_jFormattedTextField6ActionPerformed

                                    private void jFormattedTextField5ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField5ActionPerformed
}//GEN-LAST:event_jFormattedTextField5ActionPerformed

                                    private void jFormattedTextField4ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField4ActionPerformed
}//GEN-LAST:event_jFormattedTextField4ActionPerformed

                                    private void jFormattedTextField3ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField3ActionPerformed
}//GEN-LAST:event_jFormattedTextField3ActionPerformed

                                    private void jFormattedTextField2ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField2ActionPerformed
}//GEN-LAST:event_jFormattedTextField2ActionPerformed

                                    private void jButton6ActionPerformed(ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
                                        SendActionClicked();
                                    }//GEN-LAST:event_jButton6ActionPerformed
    public void updateText(String Text){
        //updates the textArea1 with new text upon request
        jTextArea1.append(Text + "\n");
        jTextArea1.setCaretPosition(jTextArea1.getText().length());
    }        //private static boolean AddOne;
    
    
    private void SendActionClicked(){
        try {
            WriteOut.write(jTextField1.getText());
        } catch (IOException ex) {
            Logger.getLogger(OBD2nerForm.class.getName()).log(Level.SEVERE, null, ex);
        }

        jTextField1.setText("");
        jTextArea1.setText("");
    }


    private static boolean AddOne;
      String X = "";
//Trying out the runnable method of incrementing the code
    public String getNewScannerValueRunnable(){

        Runnable doWorkRunnable = new Runnable() {
        
            @Override
            public void run() { 
               Status.form.getNewRotatingValue()
            ;}
        
        };
            SwingUtilities.invokeLater(doWorkRunnable);
       

        return X;
    }

    public String getNewRotatingValue(){

  
        AddOne=true;
        

        if ((jCheckBox10.isSelected()) && ( jCheckBox20.isSelected())){ jFormattedTextField10.setText(incrementHexIfNeeded(jFormattedTextField10.getText()));}
        if ((jCheckBox9.isSelected()) && ( jCheckBox19.isSelected())){ jFormattedTextField9.setText(incrementHexIfNeeded(jFormattedTextField9.getText()));}
        if ((jCheckBox8.isSelected()) && ( jCheckBox18.isSelected())){ jFormattedTextField8.setText(incrementHexIfNeeded(jFormattedTextField8.getText()));}
        if ((jCheckBox7.isSelected()) && ( jCheckBox17.isSelected())){ jFormattedTextField7.setText(incrementHexIfNeeded(jFormattedTextField7.getText()));}
        if ((jCheckBox6.isSelected()) && ( jCheckBox16.isSelected())){ jFormattedTextField6.setText(incrementHexIfNeeded(jFormattedTextField6.getText()));}
        if ((jCheckBox5.isSelected()) && ( jCheckBox15.isSelected())){ jFormattedTextField5.setText(incrementHexIfNeeded(jFormattedTextField5.getText()));}
        if ((jCheckBox4.isSelected()) && ( jCheckBox14.isSelected())){ jFormattedTextField4.setText(incrementHexIfNeeded(jFormattedTextField4.getText()));}
        if ((jCheckBox3.isSelected()) && ( jCheckBox13.isSelected())){ jFormattedTextField3.setText(incrementHexIfNeeded(jFormattedTextField3.getText()));}
        if ((jCheckBox2.isSelected()) && ( jCheckBox12.isSelected())){ jFormattedTextField2.setText(incrementHexIfNeeded(jFormattedTextField2.getText()));}
        if ((jCheckBox1.isSelected()) && ( jCheckBox11.isSelected())){ jFormattedTextField1.setText(incrementHexIfNeeded(jFormattedTextField1.getText())); }
        
        
        X =( ((jCheckBox1.isSelected())? jFormattedTextField1.getText(): "")+
             ((jCheckBox2.isSelected())? jFormattedTextField2.getText(): "")+
             ((jCheckBox3.isSelected())? jFormattedTextField3.getText(): "")+
             ((jCheckBox4.isSelected())? jFormattedTextField4.getText(): "")+
             ((jCheckBox5.isSelected())? jFormattedTextField5.getText(): "")+
             ((jCheckBox6.isSelected())? jFormattedTextField6.getText(): "")+
             ((jCheckBox7.isSelected())? jFormattedTextField7.getText(): "")+
             ((jCheckBox8.isSelected())? jFormattedTextField8.getText(): "")+
             ((jCheckBox9.isSelected())? jFormattedTextField9.getText(): "")+
             ((jCheckBox10.isSelected())? jFormattedTextField10.getText(): "") );
        jLabel9.setText(X);

          return X;
            }
   
    private String incrementHexIfNeeded(String Hexadecimal){
        int HexValue;
        
        Hexadecimal = Hexadecimal.trim();
        Hexadecimal = (Hexadecimal.equals(""))? "00" : Hexadecimal;
        HexValue = Integer.parseInt(Hexadecimal, 16) ;
        

         

        if (AddOne){
            ++HexValue;
            AddOne=false;
        } else{
            AddOne=false;
        }

        
        if (HexValue >=256){ 
            HexValue=0;
            AddOne=true;
        }
           String ReturnValue =(HexValue < 16) ? "0" + Integer.toHexString(HexValue) : Integer.toHexString(HexValue);
        return ReturnValue;
        
        
    }
    

    public static void newAdminForm() {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new OBD2nerForm().setVisible(true);
            }
        });
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private Checkbox checkbox1;
    private JButton jButton1;
    private JButton jButton2;
    private JButton jButton4;
    private JButton jButton5;
    private JButton jButton6;
    private static JCheckBox jCheckBox1;
    private static JCheckBox jCheckBox10;
    private static JCheckBox jCheckBox11;
    private static JCheckBox jCheckBox12;
    private static JCheckBox jCheckBox13;
    private static JCheckBox jCheckBox14;
    private static JCheckBox jCheckBox15;
    private static JCheckBox jCheckBox16;
    private static JCheckBox jCheckBox17;
    private static JCheckBox jCheckBox18;
    private static JCheckBox jCheckBox19;
    private static JCheckBox jCheckBox2;
    private static JCheckBox jCheckBox20;
    private static JCheckBox jCheckBox3;
    private static JCheckBox jCheckBox4;
    private static JCheckBox jCheckBox5;
    private static JCheckBox jCheckBox6;
    private static JCheckBox jCheckBox7;
    private static JCheckBox jCheckBox8;
    private static JCheckBox jCheckBox9;
    private JComboBox jComboBox1;
    private JComboBox jComboBox2;
    private static JFormattedTextField jFormattedTextField1;
    private static JFormattedTextField jFormattedTextField10;
    private static JFormattedTextField jFormattedTextField2;
    private static JFormattedTextField jFormattedTextField3;
    private static JFormattedTextField jFormattedTextField4;
    private static JFormattedTextField jFormattedTextField5;
    private static JFormattedTextField jFormattedTextField6;
    private static JFormattedTextField jFormattedTextField7;
    private static JFormattedTextField jFormattedTextField8;
    private static JFormattedTextField jFormattedTextField9;
    private JLabel jLabel1;
    private JLabel jLabel11;
    private JLabel jLabel2;
    private JLabel jLabel3;
    private JLabel jLabel4;
    private JLabel jLabel5;
    private JLabel jLabel6;
    private JLabel jLabel7;
    private JLabel jLabel8;
    private static JLabel jLabel9;
    private JPanel jPanel1;
    private JPanel jPanel2;
    private JPanel jPanel3;
    private JPanel jPanel5;
    private JScrollPane jScrollPane1;
    private JSeparator jSeparator1;
    private JTabbedPane jTabbedPane1;
    public static final JTextArea jTextArea1 = new JTextArea();
    private JTextField jTextField1;
    private JTextField jTextField2;
    private JTextField jTextField3;
    private JTextField jTextField4;
    private JTextField jTextField5;
    private JTextField jTextField6;
    private JToggleButton jToggleButton1;
    private JToggleButton jToggleButton2;
    private JToggleButton jToggleButton3;
    private JToolBar jToolBar1;
    private BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables

}
